Optimal. Leaf size=175 \[ \frac {2 \cos (c+d x) \sqrt {a+b \sin (c+d x)}}{3 b d}+\frac {4 a E\left (\frac {1}{2} \left (c-\frac {\pi }{2}+d x\right )|\frac {2 b}{a+b}\right ) \sqrt {a+b \sin (c+d x)}}{3 b^2 d \sqrt {\frac {a+b \sin (c+d x)}{a+b}}}-\frac {4 \left (a^2-b^2\right ) F\left (\frac {1}{2} \left (c-\frac {\pi }{2}+d x\right )|\frac {2 b}{a+b}\right ) \sqrt {\frac {a+b \sin (c+d x)}{a+b}}}{3 b^2 d \sqrt {a+b \sin (c+d x)}} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.12, antiderivative size = 175, normalized size of antiderivative = 1.00, number of steps
used = 6, number of rules used = 6, integrand size = 23, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.261, Rules used = {2774, 2831,
2742, 2740, 2734, 2732} \begin {gather*} -\frac {4 \left (a^2-b^2\right ) \sqrt {\frac {a+b \sin (c+d x)}{a+b}} F\left (\frac {1}{2} \left (c+d x-\frac {\pi }{2}\right )|\frac {2 b}{a+b}\right )}{3 b^2 d \sqrt {a+b \sin (c+d x)}}+\frac {4 a \sqrt {a+b \sin (c+d x)} E\left (\frac {1}{2} \left (c+d x-\frac {\pi }{2}\right )|\frac {2 b}{a+b}\right )}{3 b^2 d \sqrt {\frac {a+b \sin (c+d x)}{a+b}}}+\frac {2 \cos (c+d x) \sqrt {a+b \sin (c+d x)}}{3 b d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 2732
Rule 2734
Rule 2740
Rule 2742
Rule 2774
Rule 2831
Rubi steps
\begin {align*} \int \frac {\cos ^2(c+d x)}{\sqrt {a+b \sin (c+d x)}} \, dx &=\frac {2 \cos (c+d x) \sqrt {a+b \sin (c+d x)}}{3 b d}+\frac {2 \int \frac {b+a \sin (c+d x)}{\sqrt {a+b \sin (c+d x)}} \, dx}{3 b}\\ &=\frac {2 \cos (c+d x) \sqrt {a+b \sin (c+d x)}}{3 b d}+\frac {1}{3} \left (2 \left (1-\frac {a^2}{b^2}\right )\right ) \int \frac {1}{\sqrt {a+b \sin (c+d x)}} \, dx+\frac {(2 a) \int \sqrt {a+b \sin (c+d x)} \, dx}{3 b^2}\\ &=\frac {2 \cos (c+d x) \sqrt {a+b \sin (c+d x)}}{3 b d}+\frac {\left (2 a \sqrt {a+b \sin (c+d x)}\right ) \int \sqrt {\frac {a}{a+b}+\frac {b \sin (c+d x)}{a+b}} \, dx}{3 b^2 \sqrt {\frac {a+b \sin (c+d x)}{a+b}}}+\frac {\left (2 \left (1-\frac {a^2}{b^2}\right ) \sqrt {\frac {a+b \sin (c+d x)}{a+b}}\right ) \int \frac {1}{\sqrt {\frac {a}{a+b}+\frac {b \sin (c+d x)}{a+b}}} \, dx}{3 \sqrt {a+b \sin (c+d x)}}\\ &=\frac {2 \cos (c+d x) \sqrt {a+b \sin (c+d x)}}{3 b d}+\frac {4 a E\left (\frac {1}{2} \left (c-\frac {\pi }{2}+d x\right )|\frac {2 b}{a+b}\right ) \sqrt {a+b \sin (c+d x)}}{3 b^2 d \sqrt {\frac {a+b \sin (c+d x)}{a+b}}}+\frac {4 \left (1-\frac {a^2}{b^2}\right ) F\left (\frac {1}{2} \left (c-\frac {\pi }{2}+d x\right )|\frac {2 b}{a+b}\right ) \sqrt {\frac {a+b \sin (c+d x)}{a+b}}}{3 d \sqrt {a+b \sin (c+d x)}}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.77, size = 145, normalized size = 0.83 \begin {gather*} \frac {2 b \cos (c+d x) (a+b \sin (c+d x))-4 a (a+b) E\left (\frac {1}{4} (-2 c+\pi -2 d x)|\frac {2 b}{a+b}\right ) \sqrt {\frac {a+b \sin (c+d x)}{a+b}}+4 \left (a^2-b^2\right ) F\left (\frac {1}{4} (-2 c+\pi -2 d x)|\frac {2 b}{a+b}\right ) \sqrt {\frac {a+b \sin (c+d x)}{a+b}}}{3 b^2 d \sqrt {a+b \sin (c+d x)}} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [B] Leaf count of result is larger than twice the leaf count of optimal. \(461\) vs.
\(2(225)=450\).
time = 1.68, size = 462, normalized size = 2.64
method | result | size |
default | \(\frac {\frac {4 \sqrt {\frac {a +b \sin \left (d x +c \right )}{a -b}}\, \sqrt {-\frac {\left (\sin \left (d x +c \right )-1\right ) b}{a +b}}\, \sqrt {-\frac {\left (1+\sin \left (d x +c \right )\right ) b}{a -b}}\, \EllipticF \left (\sqrt {\frac {a +b \sin \left (d x +c \right )}{a -b}}, \sqrt {\frac {a -b}{a +b}}\right ) a^{2} b}{3}-\frac {4 \sqrt {\frac {a +b \sin \left (d x +c \right )}{a -b}}\, \sqrt {-\frac {\left (\sin \left (d x +c \right )-1\right ) b}{a +b}}\, \sqrt {-\frac {\left (1+\sin \left (d x +c \right )\right ) b}{a -b}}\, \EllipticF \left (\sqrt {\frac {a +b \sin \left (d x +c \right )}{a -b}}, \sqrt {\frac {a -b}{a +b}}\right ) b^{3}}{3}-\frac {4 \sqrt {\frac {a +b \sin \left (d x +c \right )}{a -b}}\, \sqrt {-\frac {\left (\sin \left (d x +c \right )-1\right ) b}{a +b}}\, \sqrt {-\frac {\left (1+\sin \left (d x +c \right )\right ) b}{a -b}}\, \EllipticE \left (\sqrt {\frac {a +b \sin \left (d x +c \right )}{a -b}}, \sqrt {\frac {a -b}{a +b}}\right ) a^{3}}{3}+\frac {4 \sqrt {\frac {a +b \sin \left (d x +c \right )}{a -b}}\, \sqrt {-\frac {\left (\sin \left (d x +c \right )-1\right ) b}{a +b}}\, \sqrt {-\frac {\left (1+\sin \left (d x +c \right )\right ) b}{a -b}}\, \EllipticE \left (\sqrt {\frac {a +b \sin \left (d x +c \right )}{a -b}}, \sqrt {\frac {a -b}{a +b}}\right ) a \,b^{2}}{3}-\frac {2 b^{3} \left (\sin ^{3}\left (d x +c \right )\right )}{3}-\frac {2 a \,b^{2} \left (\sin ^{2}\left (d x +c \right )\right )}{3}+\frac {2 b^{3} \sin \left (d x +c \right )}{3}+\frac {2 a \,b^{2}}{3}}{b^{3} \cos \left (d x +c \right ) \sqrt {a +b \sin \left (d x +c \right )}\, d}\) | \(462\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Failed to integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [C] Result contains higher order function than in optimal. Order 9 vs. order
4.
time = 0.11, size = 408, normalized size = 2.33 \begin {gather*} -\frac {2 \, {\left (3 i \, \sqrt {2} a \sqrt {i \, b} b {\rm weierstrassZeta}\left (-\frac {4 \, {\left (4 \, a^{2} - 3 \, b^{2}\right )}}{3 \, b^{2}}, -\frac {8 \, {\left (8 i \, a^{3} - 9 i \, a b^{2}\right )}}{27 \, b^{3}}, {\rm weierstrassPInverse}\left (-\frac {4 \, {\left (4 \, a^{2} - 3 \, b^{2}\right )}}{3 \, b^{2}}, -\frac {8 \, {\left (8 i \, a^{3} - 9 i \, a b^{2}\right )}}{27 \, b^{3}}, \frac {3 \, b \cos \left (d x + c\right ) - 3 i \, b \sin \left (d x + c\right ) - 2 i \, a}{3 \, b}\right )\right ) - 3 i \, \sqrt {2} a \sqrt {-i \, b} b {\rm weierstrassZeta}\left (-\frac {4 \, {\left (4 \, a^{2} - 3 \, b^{2}\right )}}{3 \, b^{2}}, -\frac {8 \, {\left (-8 i \, a^{3} + 9 i \, a b^{2}\right )}}{27 \, b^{3}}, {\rm weierstrassPInverse}\left (-\frac {4 \, {\left (4 \, a^{2} - 3 \, b^{2}\right )}}{3 \, b^{2}}, -\frac {8 \, {\left (-8 i \, a^{3} + 9 i \, a b^{2}\right )}}{27 \, b^{3}}, \frac {3 \, b \cos \left (d x + c\right ) + 3 i \, b \sin \left (d x + c\right ) + 2 i \, a}{3 \, b}\right )\right ) - 3 \, \sqrt {b \sin \left (d x + c\right ) + a} b^{2} \cos \left (d x + c\right ) + \sqrt {2} {\left (2 \, a^{2} - 3 \, b^{2}\right )} \sqrt {i \, b} {\rm weierstrassPInverse}\left (-\frac {4 \, {\left (4 \, a^{2} - 3 \, b^{2}\right )}}{3 \, b^{2}}, -\frac {8 \, {\left (8 i \, a^{3} - 9 i \, a b^{2}\right )}}{27 \, b^{3}}, \frac {3 \, b \cos \left (d x + c\right ) - 3 i \, b \sin \left (d x + c\right ) - 2 i \, a}{3 \, b}\right ) + \sqrt {2} {\left (2 \, a^{2} - 3 \, b^{2}\right )} \sqrt {-i \, b} {\rm weierstrassPInverse}\left (-\frac {4 \, {\left (4 \, a^{2} - 3 \, b^{2}\right )}}{3 \, b^{2}}, -\frac {8 \, {\left (-8 i \, a^{3} + 9 i \, a b^{2}\right )}}{27 \, b^{3}}, \frac {3 \, b \cos \left (d x + c\right ) + 3 i \, b \sin \left (d x + c\right ) + 2 i \, a}{3 \, b}\right )\right )}}{9 \, b^{3} d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \frac {\cos ^{2}{\left (c + d x \right )}}{\sqrt {a + b \sin {\left (c + d x \right )}}}\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [F]
time = 0.00, size = -1, normalized size = -0.01 \begin {gather*} \int \frac {{\cos \left (c+d\,x\right )}^2}{\sqrt {a+b\,\sin \left (c+d\,x\right )}} \,d x \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________